package o;

import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class bol implements bkm {
    private ArrayList<String> mApkUris;
    private long mDownloadId;
    private boy mDownloadStateBuilder;
    private bpg mDownloadTaskBuilder;
    private ArrayList<Integer> mFeatureTitleResIds;
    private ArrayList<String> mFeatures;
    private long mInstallId;
    private bpc mInstallTaskBuilder;
    private String mInvokeToken;
    private boolean mIsProcessing;
    private ArrayList<String> mLanguages;
    private ArrayList<String> mParamFeatures;
    private ArrayList<String> mParamLanguages;
    private String mPkgName;
    private int mSessionId;
    private long mStartTime;
    private int mType;
    private bpd mUninstallTaskBuilder;
    private int mVersionCode;

    public bol() {
        this.mSessionId = -1;
        this.mStartTime = Long.MAX_VALUE;
    }

    public bol(@NonNull String str, long j) {
        this.mSessionId = -1;
        this.mStartTime = Long.MAX_VALUE;
        this.mSessionId = boi.ˏ();
        this.mPkgName = str;
        this.mVersionCode = bla.ॱ(ContentManager.getInstant().getContext(), str);
        this.mType = 10;
        this.mDownloadId = j;
    }

    public void ˎ(@NonNull bpc o_bpc, ArrayList<Uri> arrayList, boy o_boy) {
        this.mType = 11;
        this.mIsProcessing = false;
        this.mInstallTaskBuilder = o_bpc;
        if (arrayList != null) {
            this.mApkUris = new ArrayList();
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                this.mApkUris.add(((Uri) it.next()).toString());
            }
        }
        this.mDownloadStateBuilder = o_boy;
        this.mStartTime = System.currentTimeMillis();
    }

    public void ˏ(@NonNull bpc o_bpc) {
        this.mType = 21;
        this.mIsProcessing = false;
        this.mInstallTaskBuilder = o_bpc;
        this.mStartTime = System.currentTimeMillis();
    }

    public bol(@NonNull String str, bpg o_bpg) {
        this.mSessionId = -1;
        this.mStartTime = Long.MAX_VALUE;
        this.mSessionId = boi.ˏ();
        this.mPkgName = str;
        this.mVersionCode = bla.ॱ(ContentManager.getInstant().getContext(), str);
        this.mType = 20;
        this.mDownloadTaskBuilder = o_bpg;
        this.mStartTime = System.currentTimeMillis();
    }

    public bol(@NonNull String str, bpd o_bpd) {
        this.mSessionId = -1;
        this.mStartTime = Long.MAX_VALUE;
        this.mSessionId = boi.ˏ();
        this.mPkgName = str;
        this.mVersionCode = bla.ॱ(ContentManager.getInstant().getContext(), str);
        this.mType = 30;
        this.mUninstallTaskBuilder = o_bpd;
        this.mStartTime = System.currentTimeMillis();
    }

    public void ˊ(String str) {
        this.mInvokeToken = str;
    }

    @NonNull
    public String ˊ() {
        return bkz.ˊ(this.mInvokeToken);
    }

    public void ˎ(boolean z) {
        this.mIsProcessing = z;
    }

    public void ˊ(long j) {
        this.mDownloadId = j;
    }

    public void ˋ(long j) {
        this.mInstallId = j;
    }

    public void ˋ(@NonNull bpc o_bpc) {
        this.mInstallTaskBuilder = o_bpc;
    }

    public int ˏ() {
        return this.mSessionId;
    }

    public int ॱ() {
        return ˏ(this.mSessionId);
    }

    public static int ˏ(int i) {
        return 65535 & i;
    }

    @NonNull
    public String ˋ() {
        return this.mPkgName == null ? "" : this.mPkgName;
    }

    public int ˎ() {
        return this.mVersionCode;
    }

    public int ʻ() {
        return this.mType;
    }

    public boolean ʼ() {
        return this.mType == 10 || this.mType == 11;
    }

    public boolean ᐝ() {
        return this.mIsProcessing;
    }

    public long ʽ() {
        return this.mDownloadId;
    }

    public long ॱॱ() {
        return this.mInstallId;
    }

    @Nullable
    public bpg ˋॱ() {
        return this.mDownloadTaskBuilder;
    }

    @Nullable
    public bpc ˊॱ() {
        return this.mInstallTaskBuilder;
    }

    @Nullable
    public ArrayList<Uri> ˏॱ() {
        if (this.mApkUris == null) {
            return null;
        }
        ArrayList<Uri> arrayList = new ArrayList();
        Iterator it = this.mApkUris.iterator();
        while (it.hasNext()) {
            String str = (String) it.next();
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(Uri.parse(str));
            }
        }
        return arrayList;
    }

    @Nullable
    public boy ͺ() {
        return this.mDownloadStateBuilder;
    }

    @Nullable
    public bpd ॱˊ() {
        return this.mUninstallTaskBuilder;
    }

    public void ˎ(ArrayList<Integer> arrayList) {
        this.mFeatureTitleResIds = arrayList;
    }

    public void ˋ(ArrayList<String> arrayList) {
        this.mFeatures = arrayList;
    }

    public void ˏ(ArrayList<String> arrayList) {
        this.mLanguages = arrayList;
    }

    @NonNull
    public List<Integer> ॱˎ() {
        return bkz.ˏ(this.mFeatureTitleResIds);
    }

    @NonNull
    public List<String> ॱᐝ() {
        return bkz.ˏ(this.mLanguages);
    }

    public long ᐝॱ() {
        return this.mStartTime;
    }

    public void ˏ(String str, String str2) {
        if ("feature".equals(str)) {
            if (this.mParamFeatures == null) {
                this.mParamFeatures = new ArrayList();
            }
            this.mParamFeatures.add(str2);
        } else if ("language".equals(str)) {
            if (this.mParamLanguages == null) {
                this.mParamLanguages = new ArrayList();
            }
            this.mParamLanguages.add(str2);
        }
    }

    public ArrayList<String> ॱˋ() {
        return this.mParamFeatures;
    }

    public ArrayList<String> ʻॱ() {
        return this.mParamLanguages;
    }
}
